{
  "properties" : { },
  "id" : "d27379e018c647238ed0dc11460443bb",
  "script" : null,
  "groupId" : "87746fd906e04f488032f0a4a45f1c06",
  "name" : "菜单",
  "createTime" : 1714063372688,
  "updateTime" : 1710917264039,
  "lock" : null,
  "createBy" : "管理员",
  "updateBy" : "管理员",
  "path" : "menu",
  "method" : "GET",
  "parameters" : [ ],
  "options" : [ {
    "name" : "require_login",
    "value" : "true",
    "description" : "该接口需要登录才允许访问",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import 'com.wiwf.model.security.service.SysTokenService' as sysTokenService;

import '@/user/getNodeMenu' as getNodeMenu;

// get menu
var user = sysTokenService.getTokenUser();
var baseMenus = user.getMenus();

// get menu tree
var treeMenu = [];
for (menu in baseMenus) {
  var tMenu = {};
  if(menu.type == 0 && menu.parentId == 0){
    tMenu = { "id": menu.path, "icon": menu.icon, "title": menu.menuName, "children": [],"menuId": menu.menuId };
    getNodeMenu(baseMenus, tMenu);
  } else if(menu.type == 2){
    tMenu = { "id": menu.path, "icon": menu.icon, "title": menu.menuName, "type": "modal" };
  } else if(menu.type == 3){
    tMenu = { "id": menu.path, "icon": menu.icon, "title": menu.menuName, "type": "blank" };
  }

  if(menu.parentId == 0){
    treeMenu.add(tMenu);
  }
}

return treeMenu;